import wx
from Arvore import Arvore
from FrameRelatorio import FrameRelatorio




class PanelRelatorio(wx.Panel):
    def _init_ctrls(self, prnt):
       
        wx.Panel.__init__(self, id=-1, name='', parent=prnt, size=wx.Size(411, 213),#pos=(411, 213),
              style=wx.TAB_TRAVERSAL)
        self.SetClientSize(wx.Size(420, 320))

        self.parent = prnt
        
        self.labelCadastrarPessoa = wx.StaticText(id=-1,
              label='Relatorio Por Cliente', name='staticText1', parent=self,
              pos=wx.Point(115, 2), size=wx.Size(107, 23), style=0)
        self.labelCadastrarPessoa.SetFont(wx.Font(12, wx.SWISS, wx.NORMAL, wx.BOLD,
              False, 'Tahoma'))

        

        self.labelNumero = wx.StaticText(id=-1, label='No Cartao: ', name='staticText1',
              parent=self, pos=wx.Point(40, 38), size=wx.Size(42, 14), style=0)
        self.labelNumero.SetFont(wx.Font(9, wx.SWISS, wx.NORMAL, wx.BOLD, False,
              'Tahoma'))

        self.labelCnpj = wx.StaticText(id=-1, label='CNPJ: ', name='staticText1',
              parent=self, pos=wx.Point(40, 60), size=wx.Size(42, 14), style=0)
        self.labelCnpj.SetFont(wx.Font(9, wx.SWISS, wx.NORMAL, wx.BOLD, False,
              'Tahoma'))

     

        self.textNumero = wx.TextCtrl(id=-1, name='textCtrl2', parent=self,
              pos=wx.Point(120, 38), size=wx.Size(192, 21), style=0)

        self.textCnpj = wx.TextCtrl(id=-1, name='textCtrl2', parent=self,
              pos=wx.Point(120, 60), size=wx.Size(192, 21), style=0)
        
        self.botaoEmitir = wx.Button(id=11, label='Emitir',
              name='button1', parent=self, pos=wx.Point(330, 38),
              size=wx.Size(75, 23), style=0)

        self.botaoEmitir2 = wx.Button(id=12, label='Emitir',
              name='button1', parent=self, pos=wx.Point(330, 60),
              size=wx.Size(75, 23), style=0)
        
         
        
        self.Bind(wx.EVT_BUTTON, self.emitir, id=11)
        self.Bind(wx.EVT_BUTTON, self.emitirE, id=12)
        
        
    def emitir(self, event):        
        numero = int(self.textNumero.GetValue())
        FrameRelatorio(None, -1, ":: BSI Card ::", numero,'cartao')

    def emitirE(self, event):        
        numero = int(self.textCnpj.GetValue())
        FrameRelatorio(None, -1, ":: BSI Card ::", numero,'estabelecimento')
            
                
            
        

    def __init__(self, parent):
        
        
        self._init_ctrls(parent)
        self.AcceptsFocus()
        self.Enable(True)
